/*******************************************OVERVIEW****************************************************************
 
"Reassessing the Link between Revolutionary Threats and Democratization" 
 
Replication File
 
Table 1
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 

cd "/Users/YourFiles/Replication/";


/*Create Log File*/;

log using "Table 1", replace text;


/*Load Data File*/;

use "distance_sevenoaks.dta";


/*Merge With AF's data - You will need to download AF's replicaton files*/;

/* https://www.econometricsociety.org/publications/econometrica/browse/2015/03/01/democratization-under-threat-revolution-evidence-great-reform */;

/*Please use the data file data_pre_reform.dta*/;


merge 1:1 consid using "/Users/YourFiles/11484_Data_and_Programs/data/data_pre_reform.dta";

global employment_1821 "h_index_1821 p_agriculture_1821 p_trade_1821 population_1821 density1821";
global base_1826_swing "share1820 share1820_2 county university narrow  rottenindex_1826 "; 


reg share1826 constriots10 $base_1826_swing $employment_1821, cluster(county_id); 

reg share1826 road_dissevenoaks_const_km $base_1826_swing $employment_1821, cluster(county_id); 

ivreg2 share1826 (constriots10 = road_dissevenoaks_const_km) $base_1826_swing $employment_1821, first cluster(county_id); 

reg share1826 cum_food_riots $base_1826_swing $employment_1821, cluster(county_id); 



log c;
